#pragma once
#include "DXAMLCommon.h"
#include "CXcpObjectBase.h"
#include "CXcpObjectThreadSafeAddRefPolicy.h"
#include "CSitePermissions.h"

class CSitePermissionEnumerator;

class CPermissionManager :
	public CXcpObjectBase<NoBaseClass,CXcpObjectThreadSafeAddRefPolicy>
{

public: 
	static HRESULT Create(struct IPALSettingsDictionaryNode *, CPermissionManager * *);
	HRESULT GetPermissionsForSite(const CXString *, CSitePermissions * *);
	HRESULT GetSiteEnumerator(CSitePermissionEnumerator * *);
protected: 
	CPermissionManager();
	virtual ~CPermissionManager();
	HRESULT Initialize(struct IPALSettingsDictionaryNode *);
	xref_ptr<IPALSettingsDictionaryNode> m_SettingsStorage;
	xvector<xref_ptr<CSitePermissions> > m_CachedPermissions;
};